/**
 * 用户接口
 */

import { Get, Post, Delete, Put, RequestParams, ResponseData } from '../../common/decorator'

export default class UserService {
  // 查询用户列表
  @Get("/system/user/list")
  listUser(res: object) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  // 查询用户详细
  @Get("/system/user/${userId}", { requestType: 'path' })
  getUser(res: { userId: any }) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  // 新增用户
  @Post("/system/user", { requestType: 'data' })
  addUser(res: object) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  // 修改用户
  @Put("/system/user", { requestType: 'data' })
  updateUser(res: object) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  @Delete("/system/user/${userId}", { requestType: 'path' })
  delUser(res: { userId: any }) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  @Put("/system/user/resetPwd", { requestType: 'data' })
  resetUserPwd(res: object) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  @Put("/system/user/changeStatus", { requestType: 'data' })
  changeUserStatus(res: { userId: string, status: string }) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  @Get("/system/user/profile")
  getUserProfile(res: void) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  @Put("/system/user/profile", { requestType: 'data' })
  updateUserProfile(res: object) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  @Put("/system/user/profile/updatePwd", { requestType: 'params' })
  updateUserPwd(res: { oldPassword: string, newPassword: string }) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  @Post("/system/user/profile/avatar", { requestType: 'data' })
  uploadAvatar(res: object) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  @Get("/system/user/authRole/${userId}", { requestType: 'path' })
  getAuthRole(res: { userId: string }) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  @Put("/system/user/authRole", { requestType: 'params' })
  updateAuthRole(res: object) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }

  @Get("/system/user/deptTree")
  deptTreeSelect(res: void) {
    const convertedResult: unknown = res as unknown;
    return convertedResult as Promise<ResponseData>
  }
}
